package chances.webui.taglibs;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;

@SuppressWarnings("serial")
public class ToolbarTag extends BodyTagSupport{
	private boolean footer;
	
	
	@Override
	public int doEndTag() throws JspException {
		ToolbarUITag toolbarUITag = (ToolbarUITag) findAncestorWithClass(this, ToolbarUITag.class);
		if(toolbarUITag!=null){
			if(!this.footer){
				toolbarUITag.setHeader(this.getBodyContent().getString());
			}else{
				toolbarUITag.setFooter(this.getBodyContent().getString());
			}
			return super.doEndTag();
		}else{
			return SKIP_BODY;
		}

	}
	public boolean isFooter() {
		return footer;
	}
	public void setFooter(boolean footer) {
		this.footer = footer;
	}

	
	
	
	
}
